The present invention relates to a deviation detecting device which detects the amount of deviation of first and second images of a target object from their reference positions through detection of light intensity distributions of the first and second images for determination of the focus condition of an objective lens relative to the target object or for determination of the distance to the target object. The first and second images of the target object, which are correlated with each other, are formed in such a manner that their relative positions vary according to the focus condition of the objective lens relative to the target object or the distance to the target object.
In the deviation detecting device of the type described above, the first and second images are respectively detected by first and second light distribution detecting means which produce time-seriated outputs representative of the light intensity distributions of the first and second images respectively. The output of the second light distribution detecting means is sequentially shifted by a predetermined quantity relative to the output of the first light distribution detecting means and the degree of the correlation between these outputs at each shift position is then calculated. Of the correlation degrees so calculated, the highest correlation degree is determined and thereafter the highest correlation shift position providing the highest correlation degree is determined. The amount of deviation of the first and second images from their reference positions are then determined based on the amount of shift from a reference shift position to the highest correlation shift position. The reliability of the deviation detection performed in the manner so far described depends on whether or not the highest correlation degree so calculated has a reliable value, and a method for determining the reliability is suggested in U.S. Pat. Nos. 4,305,657 and 4,561,749.
According to U.S. Pat. No. 4,305,657, it is determined that the deviation direction is reliable if the highest correlation degree at the highest correlation shift position is greater than a predetermined value and that the deviation detection is not reliable if the maximum correlation degree at the highest correlation shift position is smaller than the predetermined value. On the other hand, according to U.S. Pat. No. 4,561,749, comparison of the highest correlation degree at the highest correlation shift position with a predetermined value is not effected for determination of the reliability of the deviation detection. However, interpolation based on a geometric technique using the highest correlation degree at the highest correlation shift position and the correlation degrees at the next highest correlation shift positions on the both sides of the highest correlation shift position is carried out to find a value presumed to be a true highest correlation degree which more exactly indicates the coincidence between the first and second images than the highest correlation degree at the highest correlation shift position, and thereafter it is determined whether the deviation detection is reliable or not reliable, depending on whether the value found by the interpolation being greater or smaller than predetermined value.
According to these methods, it has been known that the determination of the reliability provides a good result under normal conditions wherein the correlation degrees between the outputs of the first and second light distribution detecting means decrease monotonously in opposite directions with respect to the highest correlation shift position. However, where the target object has a brightness distribution of high frequencies, or where the target object has such a low brightness that respective outputs of the first and second light distribution detecting means may predominantly contain high frequency components because of the superposition of noises, the correlation degrees tend to fluctuate and, therefore, it may happen that, even if the correlation degree which becomes highest is determined out of them, it would not represent the true highest correlation degree of the first and second images of the target object. Accordingly, in such a case, any one of the above described known methods is likely to result in an error in the result of reliability determination and, erroneous focus detection or erroneous distance measurement may take place based on the result of the deviation detection which ought to have been not reliable.